package files_controller;
import java.io.*;

public class Dir implements ICommandExecutor{
	
	public void execute(String folderName){
		File folder = new File(folderName);
		if(!folder.exists()){
			System.out.println("Directory not found: " + folderName);
		} else {
			File[] list = folder.listFiles();
			for(File file : list){
				if(file.isDirectory()){
					System.out.println("<dir> " + file.getName());
				} else if (file.isFile()){
					System.out.println("<file> " + file.getName());
				}
			}
		}
		
	}
}

